 package com.example.jsonwithfile.user;


import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@RestController
@RequestMapping
public class Controller {

    /*
    curl -v -H "Content-Type: multipart/form-data" -F"file=@F:\下载\curl-7.61.1-win64-mingw\bin\qqq.jpg"
    -Fuser="{\"name\": \"name\",\"id\":\"111\"};type=application/json" -X POST  http://127.0.0.1:80/hi
     */
    @PostMapping("/hi")
    public String testJsonWithFile(@RequestPart User user,@RequestPart MultipartFile file){

//        System.out.println(user);

        return "";
    }

    @PostMapping("/hii")
    public String testJsonWithFile2(@RequestParam("user") String user,MultipartFile file){

        System.out.println(user);


        return "";
    }
    @PostMapping("/hello")
    public String hello(@RequestBody User user){


        System.out.println(user);


        return "";
    }

}
